package models

import (
	"gorm.io/gorm"
	"time"
)

// 用户里程表
type UserMileageInformation struct {
	Id                   uint64         `gorm:"column:id;type:bigint UNSIGNED;primaryKey;not null;" json:"id"`
	UserId               int32          `gorm:"column:user_id;type:int;default:NULL;" json:"user_id"`
	TotalTravelMileage   int32          `gorm:"column:total_travel_mileage;type:int;comment:总出行里程;not null;" json:"total_travel_mileage"`          // 总出行里程
	MonthlyTravelMileage int32          `gorm:"column:monthly_travel_mileage;type:int;comment:本月出行里程;default:NULL;" json:"monthly_travel_mileage"` // 本月出行里程
	CreatedAt            time.Time      `gorm:"column:created_at;type:datetime(3);default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt            time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt            gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (u *UserMileageInformation) TableName() string {
	return "user_mileage_information"
}
